﻿using CSRedis;
using System;

namespace _005_redisTest
{
    class Program
    {
        static void Main(string[] args)
        {
            CSRedisClient csRedis = new CSRedisClient("192.168.16.102:6379,password=123456,defaultDatabase=0,poolsize=50,ssl=false,writeBuffer=10240");


            RedisHelper.Initialization(csRedis);

            Console.WriteLine(RedisHelper.Ping());

            RedisHelper.Set("ljq", "789");
            string value = RedisHelper.Get("ljq");
            Console.WriteLine(value);
            foreach (string item in RedisHelper.SMembers("lijiaqi"))
            {
                Console.WriteLine(item);
            }
            TestObj test = new TestObj() { };

            RedisHelper.Set("Object", new TestObj() { test1 = 1, test2 = 2 });
            RedisHelper.Get("Object");
            Console.ReadKey();
        }

        class TestObj
        {
            public int test1 { get; set; }
            public int test2 { get; set; }
        }
    }
}
